<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>产品展示</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
	</head>
	<style type="text/css">
<!--
.c1 {
	font-size: 13px;
	color: #FFFFFF;
}

.c2 {
	font-size: 13px;
	font-weight: bold;
	color: #FFFFFF;
}

.c3 {
	font-size: 12px;
	color: #333333;
	line-height: 18pt;
}
.title {
	font-size: 15px;
	color: #1B3E6D;
	line-height: 18pt;
	font-weight: bold;
}
-->
</style>
<script type="text/javascript">
function sAlert(title,pid){
	var shield = document.createElement("DIV");
    shield.id = "shield";
    shield.style.position = "absolute";
    shield.style.left = "0px";
    shield.style.top = "0px";
    shield.style.width = "100%";
    shield.style.height = ((document.body.clientHeight>document.body.scrollHeight)?document.body.clientHeight:document.body.scrollHeight)+"px";
    shield.style.background = "#fff";
    //shield.style.textAlign = "center";
    shield.style.zIndex = "10000";
    shield.style.filter = "alpha(opacity=0)";
    shield.style.opacity = 0;
    var alertFram = document.createElement("DIV");
    alertFram.id="alertFram";
    alertFram.style.position = "absolute";
    alertFram.style.left = "50%";
    alertFram.style.top = "50%";
    alertFram.style.marginLeft = "-125px" ;
    alertFram.style.marginTop = document.body.scrollTop+"px";
    alertFram.style.width = "300px";
    alertFram.style.height = "100px";
    alertFram.style.background = "#fff";
    alertFram.style.textAlign = "center";
    alertFram.style.lineHeight = "100px";
    alertFram.style.zIndex = "10001";
    strHtml  = '<ul style="list-style:none;margin:0px;padding:0px;width:100% height:100%"><form action="addProduct.action" method="post">';
    strHtml += '<li style="background:#87CEFA;text-align:left;padding-left:20px;font-size:14px;font-weight:bold;height:25px;line-height:25px;border:0px solid">' + title + '</li>';
    strHtml += '<li style="background:#EEFFFF;text-align:center;vertical-align :middle;font-size:12px;height:80px;line-height:50px;border-left:0px solid;border-right:0px solid;"><input type="hidden" name="pid" value="'+ pid + '"/>请输入订购数量：<input type="text" name="pnum" value="1" size="5"/></li>';
    strHtml += '<li style="background:#EEFFFF;text-align:center;font-weight:bold;height:25px;line-height:25px; border:0px solid;"><input type="submit" value="确认订购"/><input type="button" value="取    消" id="do_OK" onclick="doOk()" /></li>';
    strHtml += '</form></ul>';
    alertFram.innerHTML = strHtml;
    document.body.appendChild(alertFram);
    document.body.appendChild(shield);
    this.setOpacity = function(obj,opacity){
           if(opacity>=1)opacity=opacity/100;
           try{ obj.style.opacity=opacity; }catch(e){}
           try{ 
                  if(obj.filters.length>0 && obj.filters("alpha")){
                         obj.filters("alpha").opacity=opacity*100;
                  }else{
                         obj.style.filter="alpha(opacity=\""+(opacity*100)+"\")";
                  }
           }catch(e){}
    }
    var c = 0;
    this.doAlpha = function(){
           if (++c > 20){clearInterval(ad);return 0;}
           setOpacity(shield,c);
    }
    var ad = setInterval("doAlpha()",1);
    this.doOk = function(){
           //alertFram.style.display = "none";
           //shield.style.display = "none";
           document.body.removeChild(alertFram);
           document.body.removeChild(shield);
           document.body.onselectstart = function(){return true;}
           document.body.oncontextmenu = function(){return true;}
    }
    document.body.onselectstart = function(){return false;}
    document.body.oncontextmenu = function(){return false;}
}

</script>
	<link href="css/c1.css" rel="stylesheet" type="text/css">
	<link href="css/style.css" rel="stylesheet" type="text/css">
	<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
		<jsp:include page="top.jsp" />
		<table width="1004" border="0" align="center" cellpadding="0"
			cellspacing="0">
			<tr>
				<td height="550" align="center">
					<table width="963" height="484" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td width="192" height="484" valign="top">
								<jsp:include page="left.jsp" />
							</td>
							<td align="center" valign="top">
								<table width="99%" border="0" cellpadding="0" cellspacing="0">
									<tr background="image/page/mean_bg.jpg">
										<td height="40" background="image/page/mean_bg.jpg">
											&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
											<img src="image/page/arr.jpg" width="14" height="6">
											<span class="title">&nbsp;${ request.rankName }</span>
										</td>
									</tr>
									<tr>
										<td align="center">
											<table width="98%" border="0" align="center" cellpadding="0"
												cellspacing="0">
												<!--行循环开始-->
												<c:forEach items="${ request.rankProducts }" var="product" >
													<tr>
														<td>产品图片</td>
														<td>产品编号</td>
														<td>产品名称</td>
														<td>产品条码</td>
														<td>产品厂商</td>
														<td>产品型号</td>
														<td>产品单价</td>
														<c:if test="${ !empty session.user }">
															<td>会员价格</td>
														</c:if>
														<td>操作</td>
													</tr>
													<tr bgcolor="#FFFFFF" class="texthei" align="center" valign="middle">
													<td rowspan="2">
														<a href="productDetail.action?pid=${ product.PId }" target="_blank"><img
															src="image/product/${ product.image }" border="0" width="80px" height="60px"> </a>
													</td>
													<td height="15px">
														${ product.PId }
													</td>
													<td>
														${ product.PName }
													</td>
													<td>
														${ product.barcode }
													</td>
													<td>
														${ product.factory }
													</td>
													<td>
														${ product.model }
													</td>
													<td>
														￥<c:forEach items="${ product.prices }" var="price">
															<c:if test="${ price.ULevel == 1 }">${ price.price}</c:if>
														</c:forEach>元
													</td>
													<c:if test="${ !empty session.user }"><td><font color="red">￥<c:forEach items="${ product.prices }" var="price">
															<c:if test="${ price.ULevel == session.user.userLevel }">${ price.price}</c:if>
														</c:forEach>元</font></td></c:if>
													<td rowspan="2">
															<div class="cecmbody" id="cecmpolicy">
																<div class="leftClass">

																	<a
																		onclick="javascript:sAlert('${ product.PName }', ${ product.PId },this);">
																		<img src="image/page/buy2.gif" align="middle"
																			border="0" /> </a>

																</div>
																<div class="rightClass">
																</div>
															</div>

														</td>
												</tr>
												<tr>
													<td colspan="8" valign="top">
													<script type="text/javascript">
														var description = "${ product.description }";
														if (description.length > 110)
															description = description.substr(0, 110) + "...";
														document.write(description);
													</script>
														
													</td>
												</tr>
												</c:forEach>
											</table>
											<!--行循环结束-->
											<table width="100%" border="0" cellspacing="0"
												cellpadding="4">
												<tr valign="middle">
													<td>
														<div align="center" class="pagebar">
															${ request.pageuri }
														</div>
													</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		<jsp:include page="bottom.jsp" />
	</body>
</html>
